/*
 ============================================================================
 Name		: MainContainer.h
 Author	  : 
 Version	 : 1.0
 Copyright   : Your copyright notice
 Description : CMainContainer declaration
 ============================================================================
 */

#ifndef MAINCONTAINER_H
#define MAINCONTAINER_H

// INCLUDES
#include <coecntrl.h>
#include <eiklbo.h>
#include <akniconutils.h>

class CEikColumnListBox;

// CLASS DECLARATION

/**
 *  CMainContainer
 * 
 */
class CMainContainer : public CCoeControl, MCoeControlObserver
	{
public:
	// Constructors and destructor

	/**
	 * Destructor.
	 */
	~CMainContainer();

	/**
	 * Two-phased constructor.
	 */
	static CMainContainer* NewL(const TRect& aRect);

	/**
	 * Two-phased constructor.
	 */
	static CMainContainer* NewLC(const TRect& aRect);

private:

	/**
	 * Constructor for performing 1st stage construction
	 */
	CMainContainer();

	/**
	 * EPOC default constructor for performing 2nd stage construction
	 */
	void ConstructL(const TRect& aRect);

public:
	// Functions from base classes
	TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);

private:
	// Functions from base classes
	void SizeChanged();
	TInt CountComponentControls() const;
	CCoeControl* ComponentControl(TInt aIndex) const;
	void Draw(const TRect& aRect) const;
	void HandleControlEventL(CCoeControl* aControl, TCoeEvent aEventType);
	void HandleResourceChange( TInt aType );
	
	TKeyResponse PressSelected();

public:

    /**
    * Adds item to the listbox. Asks the item text from user with
    * data query. Item is added to the index which is currently focused.
    */
    void AddItemL();

    /**
    * Removes focused item from the listbox.
    */
    void RemoveItemL();

    /**
    * Getter for listbox item count.
    */
    TInt ItemCount();
    
private: // New functions

    /**
    * Constructs listbox, creates scroll bar, sets empty
    * list background text, and enables marquee.
    */
    void CreateListboxL();

    /**
    * Sets icons for the listbox. Only one icon is used and loaded from
    * application private directory using CIconFileProvider and
    * AknIconUtils.
    */
    void SetIconsL();

    /**
    * Sets items to the listbox.
    */
    void SetItemsL();
    
public:
	void Selected();
    
private:
	//data
    /**
    * Pointer to listbox control.
    *
    * Owned.
    */
    CEikColumnListBox* iListBox;


	};

#endif // MAINCONTAINER_H
